<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="header">
    <div class="header-body">
        <a class="header-logo" href="<%=basePath%>">
            <img src="http://cdn2.jianshu.io/assets/web/logo-58fd04f6f0de908401aa561cda6a0688.png">
        </a>
        <c:if test="${!empty user}">
            <a href="<%=basePath%>/write">
                <div class="header-option">写文章</div>
            </a>
        </c:if>
        <div class="header-container">
            <ul class="header-menu">
                <a href="<%=basePath%>">
                    <li>
                        <i class="fa fa-home">&nbsp;</i>
                        <span>首页</span>
                    </li>
                </a>
            </ul>
            <ul class="header-user">
                <c:choose>
                    <c:when test="${empty user}">
                        <a href="<%=basePath%>/login">
                            <li>
                                <span>登录</span>
                            </li>
                        </a>
                        <a href="<%=basePath%>/register">
                            <li>
                                <span>注册</span>
                            </li>
                        </a>
                    </c:when>
                    <c:otherwise>
                        <li>
                            <a href="<%=basePath%>/user/${user.base64Id}">
                                <span>
                                    <img src="http://ovnufh30p.bkt.clouddn.com/${user.headPortrait}">
                                </span>
                            </a>
                        </li>
                        <div class="drop-down">
                            <ul>
                                <a href="<%=basePath%>/user/${user.base64Id}">
                                    <li>
                                        <i class="fa fa-home"></i>
                                        <span>我的主页</span>
                                    </li>
                                </a>
                            </ul>
                            <ul>
                                <li><i class="fa fa-cog"></i>设置</li>
                            </ul>
                            <ul>
                                <a href="<%=basePath%>/feedback">
                                    <li>
                                        <i class="fa fa-commenting"></i>
                                        <span>帮助与反馈</span>
                                    </li>
                                </a>
                            </ul>
                            <ul>
                                <a href="<%=basePath%>/logout">
                                    <li>
                                        <i class="glyphicon glyphicon-log-out"></i>
                                        <span>退出</span>
                                    </li>
                                </a>
                            </ul>
                        </div>
                    </c:otherwise>
                </c:choose>
            </ul>
        </div>

    </div>

</div>